<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../layui/css/style.css" media="all">
		<script src="../layui/layui.all.js"></script>
	</head>
	<body>
		<div class="layadmin-header">
			<div class="layui-breadcrumb" lay-filter="breadcrumb">
				<a><cite>智能控制详细信息</cite></a>
			</div>
		</div>

		<div class="layui-fluid mainBody">
			<div class="layui-row">
				<div>
					<table class="layui-hide" id="test" lay-filter="test"></table>
				</div>
			</div>
		</div>
	</body>
</html>

<script>

	var $ = layui.$,
			admin = layui.admin,
			table = layui.table;
	var test = table.render({
			elem: '#test',
			data: [{"i":"A灯","city":"A灯","status":"关闭","classify1":"2019-01-13","classify":"2019-02-13"}],
			toolbar: '<div><a class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon layui-icon-add-1"></i>新增</a><a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a></div>',
			skin: 'line',
			size: 'lg' ,
			cols: [[
			  {type:'checkbox'}
			  ,{field:'', minWidth:100, title: '信号灯'}
			  ,{field:'city', width:100, title: '控制方式'}
			  ,{field:'status', width:120, title: '引导灯状态'}
			  ,{field:'classify1', width:150, title: '开始时间'}
			  ,{field:'classify', width:150, title: '结束时间'}
			  ,{
				 field:'', width:135, title: '操作', templet: function (data) {
                        return '<a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="edit">编辑</a><a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="del">删除</a>';
                    }
				}
			]],
			page:true
		});
		//头工具栏事件
		table.on('toolbar(test)', function(obj) {
			var data = table.checkStatus(obj.config.id).data;
			switch (obj.event) {
				case 'add':
					layer.open({
						type: 2,
						title:false,
						shade: 0.8,
						area: ['800px', '520px'],
						content: './iframe/setGeoItem.html?type=add',
						end: function() {
							test.reload();
						}
					});
					break;
				case 'del':
					
					break;
			};
		});
		//行工具栏事件
		table.on('tool(test)', function(obj) {
			var data = obj.data;
			switch (obj.event) {
				case 'edit':
					layer.open({
						type: 2,
						title:false,
						shade: 0.8,
						area: ['800px', '520px'],
						content: './iframe/setGeoItem.html?type=edit',
						end: function() {
							test.reload();
						}
					});
					break;
				case 'del':
					
					break;
			};
		});
</script>

